<template>
  <div>
    <van-row>
      <van-col span="8"><van-icon name="arrow-left" /></van-col>
      <van-col span="8">新增拜访信息</van-col>
      <van-col span="8" class="box"
        ><img src="../assets/我的客户/系统功能.png" alt=""
      /></van-col>
    </van-row>
    <van-cell-group>
      <van-field
        v-model="id"
        label="客户名称"
        @click="$router.push('/visitnewid')"
      />
      <van-field v-model="tellxfs" label="拜访标题" />
    </van-cell-group>
    <van-cell-group>
      <van-field v-model="valuexl" label="拜访原因" />
      <van-field v-model="valuedz" label="拜访地址" />
      <van-cell is-link @click="showPopup">拜访时间</van-cell>
        <van-datetime-picker
          v-model="currentDate"
          type="date"
          title="选择年月日"
          :min-date="minDate"
          :max-date="maxDate"
        />
      <van-field v-model="valuexb" label="拜访情况" />
      <van-field v-model="valuesscs" label="竞争信息收集情况" />
    </van-cell-group>
    <div class="app">
      <van-button round type="info" @click="add">保存</van-button>
    </div>
  </div>
  <!-- 



    custId	string	true	普通参数	客户id,搜索客户列表,拿客户id	
custName	string	false	普通参数	客户名称	
visitTime	string	true	普通参数	拜访时间	
visitAddress	string	true	普通参数	拜访地址	
visitTitle	string	true	普通参数	拜访标题	
visitReason	string	true	普通参数	拜访原因	
visitSituation	string	true	普通参数	拜访情况	
collectSituation	string	true	普通参数	竞争信息收集	
   -->
</template>

<script>
import { CustpostData} from "../request/api";
export default {
  data() {
    return {
      tellxfs: "",
      valuedz:'',
      valuexl: "",
      valuexb: "",
      valuesscs: "",
      show: false,
      minDate: new Date(2020, 0, 1),
      maxDate: new Date(2025, 10, 1),
      currentDate: new Date(),
      getid:this.$route.query.getid,
      id:this.$route.query.id
    };
  },
  methods: {
    showPopup() {
      this.show = true;
    },
    add() {
      CustpostData({
        custId:this.getid,
        custName:this.id,
        visitTime:'2020-02-20 20:00:00',
        visitAddress:this,
        visitAddress:this.valuedz,
        visitTitle:this.tellxfs,
        visitReason:this.valuexl,
        visitSituation:this.valuexb,
        collectSituation:this.valuesscs

      }).then(res=>{
        console.log(res,1231223123123);
      })
    },
  },
  created() {
   console.log(this.getid);
  },
};
</script>
 
<style lang = "less" scoped>
.van-row {
  padding: 20px;
  background-color: blue;
  .box {
    text-align: right;
  }
  img {
    width: 30px;
    height: 30px;
  }
}
.van-cell-group {
  margin-bottom: 10px;
}
.app {
  padding-left: 30px;
  .van-button {
    width: 90%;
    height: 50px;
    line-height: 50px;
    text-align: center;
  }
}
</style>